package com.yxq.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.TreeMap;

public class OpDB {
	private DB mydb;
	
	public OpDB(){
		mydb = new DB();
	}
	
	public TreeMap OpGetListBox(String sql, Object[] params){
		TreeMap<Integer, String> typeMap = new TreeMap<Integer, String>();
		mydb.doPstm(sql,params);
		try {
			ResultSet rs = mydb.getRs();
			if(rs!=null){
				while(rs.next()){					
					Integer sign=Integer.valueOf(rs.getInt("type_sign"));
					String intro=rs.getString("type_intro");
					typeMap.put(sign,intro);					
				}
				rs.close();
			}
		} catch (SQLException e) {			
			System.out.println("OpGetListBox() error!");
			e.printStackTrace();
		}finally{
			mydb.closed();			
		}
		return typeMap;	
	}
}
